<template>

  <div>
    <h1>资产列表</h1>
    <el-table
    :data="assetslist"
    border
    highlight-current-row
    style="width: 100%">

    <el-table-column
      prop="序号"
      label="年度-批次"
      sortable
      :filters="[{text: '2015', value: '2015'}, {text: '2016', value: '2016'}, {text: '2017', value: '2017'}, {text: '2018', value: '2018'}]"
      :filter-method="filterYearHandler"
      width="180">
    </el-table-column>
    <el-table-column
      prop="设备型号"
      label="设备型号"
    width="200">
    </el-table-column>
      <el-table-column
      prop="生产年月"
      label="生产年月"
      width="180">
    </el-table-column>
      <el-table-column
      prop="数量"
      label="数量"
      width="180">
    </el-table-column>
      <el-table-column
      prop="类型名称"
      label="类型"
      width="180">
    </el-table-column>
      <el-table-column
      prop="厂商"
      label="厂商"
      width="180">
    </el-table-column>

  </el-table>
    <router-view></router-view>
  </div>
</template>

<script>
import {mapActions, mapState} from "vuex";
import axios from "axios";

export default {
  name: "AssetList",
  data() {
    return {
      dialogVisible:false
    };
  },
  mounted() {
    this.getAssetList()
  },
  methods:{
    get_filter(){
      axios.get('api/filter/?key=year').then(res=>{

    })
    },
    //年度筛选
    filterYearHandler(value, row, column){
      console.log(value)
      console.log(row)
      console.log(column)
        // const property = column['property'];
        return row['年度'] == value;
    },
    ...mapActions({
      getAssetList: "getAssetsList",
      // getUserStatusList: "getUserStatusList",

    }),
  },
  computed: {
    ...mapState({
      assetslist: state => state.assetsList,
      // userStatusList: state => state.userStatusList,
    }),
  },
}
</script>

<style scoped>

</style>
